<?php

$app_modules["ff_leads"] = array(
    'slug' => __('leads'),
    'name' => __('Leads'),
    'menu_name' => __('Leads'),
    'singular_name' => __('Lead'),
    'icon' => 'user2_16.png',
    'migrate_fields_list' => array(
        'lead_source,ff_lead_source'
        , 'lead_status,ff_lead_status'
        , 'contact_gender,ff_contact_gender'
        , 'account_industry,ff_industry_type'
        , 'rating,ff_account_rating'
    ),
    'module_columns' => array('post_title', 'assign_to', 'company', 'phone', 'parent_country', 'lead_source', 'lead_status', 'post_date'),
    'module_columns_subcontent' => array('email', 'parent_city', 'mobile_phone'),
    'module_columns_formatting' => array(
        'post_title' => array(
            "schema" => "<div class='row_highlight'><span class='row_xxl '>{field}</span><br/><span class='row_m '>email: <a href='mailto:[email]'>[email]</a></span></div>"
        ),
        'phone' => array(
            "schema" => "<div class=''><span class='row_n '>{field}</span><br/><span class='row_sm '>Mobile: [mobile_phone]</span></div>"
        ),
        'parent_country' => array(
            "schema" => "<div class=''><span class='row_n '>{field}</span><br/><span class='row_sm '>city: [parent_city]</span></div>"
        ),
    ),
    'module_columns_sortby' => array('post_title', 'assign_to', 'company', 'email', 'phone', 'parent_city', 'parent_country', 'lead_source', 'lead_status', 'post_date'),
    'module_datagrid_special_action' => array(
        'do_export' => array(
            'label' => 'Export to Csv',
            'action' => 'export_csv',
            'icon_css' => 'apm_export_csv',
            //country_free'','','','''','contact_dept','contact_birth_date','',''

            'fields' => 'post_title,ref_id,assign_to,company,contact_title,contact_gender,contact_fistname,contact_lastname,email,phone,mobile_phone,secondary_email,fax,secondary_phone,contact_skype,contact_msn,account_website,parent_city,parent_country,country_free,account_annual_revenue,account_nb_employees,rating,account_industry,lead_source,lead_status,post_date',
            /* 'sub_entity'=>'users',
              'sub_id_source'=>'locker_user_id',
              'sub_fields'=>'user_email',
              'sub_fields_label'=>'Email', */
            'tooltip' => 'This will export in csv all the records currenlty filter by search, or all records if no search (dont need to select records...)'
        ),
    ),
    'module_dashboard_widgets' => array(
       /* '10_latest' => array(
            'label' => 'Latest Leads',
            'type' => 'latest_list',
            //'show_date'=>true,
            'fields' => array('assign_to', 'company')
        ),
        'my_leads' => array(
            'label' => 'My Leads',
            'top_string' => 'My {latest} {total_items} assigned Leads',
            'type' => 'filtered_list',
            'filters' => array(
                'assign_to' => array("value" => array(1))
            ),
            //'show_date'=>true,
            'fields' => array('assign_to', 'company')
        ),*/
    ),
    'module_new_categories' => array('cat15_leads'),
    //'module_categories' => array('cat15_leads'),
    'module_tags' => array('tag15_crm'),
    'relation_notif_config' => array(
        'notifications_model' => array(
        ),
        'team_model' => array(
            'get_parent_team' => true,
            'force_get_parent_team' => false,
            'cascade_child_team' => true,
            'force_child_team' => false,
        ),
        'relationships' => array(
            'parent' => array(//many to one
            ),
            'childs' => array(//one to many
            ),
            'related' => array(//many to many
            ),
        ),
    ),
    'module_columns_filters' => array('assign_to', 'parent_city', 'parent_country', 'lead_source', 'lead_status'),
    'module_columns_config' => array(
        'header_a_z' => true,
        'grid_type' => 'ajax_data',
        'use_paging' => true,
        'use_global_default_paging_nb' => true, //THIS MUST BE SET IN GENERAL OPTION, with option 'default_paging_nb'
        //'nb_by_page'=>20, //To FORCE A SPECIFIC PAGING NB FOR THIS MODULE. WILL OVERHIDE THE use_global_default_paging_nb NB
        'user_can_change_paging_nb_by_module' => true,
    ),
    'metaboxes' => array(
        'quickadd' => array(
            'title' => __('Quick Add'),
            'context' => 'side',
            'priority' => 'high',
            'positioning' => array(
                'main' => array(
                //  array('convert_lead'),
                ),
                'tabs' => array(
                    'tab_l0' => array(
                        'label' => 'Quick add',
                        'items' => array(
                            array('quick_add_task'),
                            array('quick_add_event'),
                            array('quick_add_call'),
                            array('quick_add_note'),
                        )
                    )
                )
            )
        ),
        'team_notif' => array(
            'title' => __('Teams / Categories'),
            'context' => 'side',
            'priority' => 'high',
            'positioning' => array(
                /* 'main' => array(
                  array('assign_to'),
                  ), */

                'tabs' => array(
                    'tabltwo' => array(
                        'label' => 'Team & Notifications',
                        'items' => array(
                            array('team_assignments'),
                        )
                    ),
                    'tablone' => array(
                        'label' => 'Categories',
                        'items' => array(
                            array('categories_list'),
                        )
                    )
                )
            )
        ),
        'lead_information' => array(
            'title' => __('Lead Information'),
            'context' => 'advanced',
            'priority' => 'high',
            'positioning' => array(
                'topbar' => array(
                    'special' => array('convert_lead', '-', 'assign_to',),
                    'common' => array(
                        'delete_action' => true,
                        'status_action' => true,
                        'save_action' => true,)
                ),
                'main' => array(
                    array(
                        'ref_id', 'rating', 'contact_set_title'
                    ),
                    array(
                        'lead_source', 'lead_status'
                    ),
                    array(
                        'source_description_simple', 'status_description_simple'
                    ),
                    array(
                        'created_by', 'created_date', 'modified_date'
                    ),
                    array(
                        'full_description_label'
                    ),
                ),
                'tabs' => array(
                    'tab_40' => array(
                        'label' => 'Lead Company infos',
                        'items' => array(
                            array(
                                'company', 'contact_dept',
                            ),
                            array(
                                'account_website', 'account_industry',
                            ),
                            array(
                                'account_annual_revenue', 'account_nb_employees',
                            ),
                        )
                    ),
                    'tab_0' => array(
                        'label' => 'Lead Contact infos',
                        'items' => array(
                            array(
                                'contact_gender', 'contact_fistname', 'contact_lastname'
                            ),
                            array(
                                'contact_title'
                            ),
                            array(
                                'email', 'secondary_email', 'perso_email'
                            ),
                            array(
                                'phone', 'secondary_phone', 'home_phone'
                            ),
                            array(
                                'fax', 'mobile_phone', 'mobile_phone_sec'
                            ),
                            array(
                                'contact_birth_date', 'contact_skype', 'contact_msn', 'other_im'
                            ),
                            array(
                                'facebook_username', 'twitter_username', 'other_sns_username'
                            ),
                        )
                    ),
                    'tab_3' => array(
                        'label' => 'Addresse',
                        'items' => array(
                            array('street', 'state', 'zipcode'),
                            array('parent_city'),
                            array('parent_country', 'country_free'),
                            array('country_webform', 'city_webform'),
                        )
                    ),
                )
            )
        )
        , 'main_childs_items' => array(
            'title' => __('Comments and Files'),
            'context' => 'advanced',
            'priority' => 'high',
            'positioning' => array(
                'tabs' => array(
                    'tabcomments' => array(
                        'label' => 'Comments',
                        'items' => array(
                            array('comments'),
                        )
                    ),
                    'tabfiles' => array(
                        'label' => 'Files',
                        'items' => array(
                            array('files_upload'),
                        )
                    )
                )
            )
        )
        , 'childs_items' => array(
            'title' => __('Related Items'),
            'context' => 'advanced',
            'priority' => 'high',
            'positioning' => array(
                'tabs' => array(
                    'tab_5b' => array(
                        'label' => 'Tasks',
                        'items' => array(
                            array('ff_lead_child_tasks')
                        )
                    ),
                    'tab_6b' => array(
                        'label' => 'Cases',
                        'items' => array(
                            array('ff_lead_child_cases')
                        )
                    ),
                    'tab_15b' => array(
                        'label' => 'Newsletters',
                        'items' => array(
                            array('ff_lead_child_newsletter')
                        )
                    ),
                    'tab_7b' => array(
                        'label' => 'Events',
                        'items' => array(
                            array('ff_lead_child_events')
                        )
                    ),
                    'tab_8b' => array(
                        'label' => 'Call logs',
                        'items' => array(
                            array('ff_lead_child_calls')
                        )
                    ),
                    'tab_14b' => array(
                        'label' => 'Notes',
                        'items' => array(
                            array('ff_lead_child_notes')
                        )
                    ),
                )
            )
        )
    )
);

